<!--_meta 作为公共模版分离出去-->
<#include "include/_meta.html">
<!--/meta 作为公共模版分离出去-->

<title>车辆审核</title>
<meta name="keywords" content="汽车租赁">
<meta name="description" content="H-ui.admin v2.3，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form-insurance-add"   >
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>审核订单ID:</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${map.check.checkId}" placeholder="审核订单ID" id="checkId" name="checkId" >
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>汽车ID:</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${(map.check.carId?c)!}" placeholder="汽车ID" id="carId" name="carId">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>订单ID：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${map.check.orderID}" placeholder="订单ID" id="orderID" name="orderID">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>审核人ID：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${(map.check.userId?c)!}" placeholder="审核人ID" id="userId" name="userId">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>车审后应该赔偿的总价(不包含违章)：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${(map.CarSunP?c)!}" placeholder="车审后应该赔偿的总价(不包含违章)" id="CarSunP" name="CarSunP">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>该订单油电总价：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${(map.OEP?c)!}" placeholder="该订单油电总价" id="OEP" name="OEP">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>该汽车的服务费：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${(map.carHygieneMoney?c)!}" placeholder="该汽车的服务费" id="carHygieneMoney" name="carHygieneMoney">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>订单租车金额：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${(map.AlldayMoney?c)!}" placeholder="订单租车金额" id="AlldayMoney" name="AlldayMoney">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>订单押金：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${(map.orderDeposit?c)!}" placeholder="订单押金" id="orderDeposit" name="orderDeposit">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>还需支付总数：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" readonly="readonly" autocomplete="off" value="${(map.allP?c)!}" placeholder="还需支付总数" id="allP" name="allP">
            </div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input onclick="valitade(1)" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;支付租金-支付宝&nbsp;&nbsp;"/>
                <input onclick="valitade(2)" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;支付租金-现&nbsp;&nbsp;&nbsp;金&nbsp;&nbsp;"/>
            </div>
        </div>
    </form>
</article>
<script>

    var valitade = function (type) {
        let mustData = ['checkId','carId','orderID','userId','CarSunP','OEP','carHygieneMoney','AlldayMoney','orderDeposit','allP'];
        let mustDataTip = ['审核订单ID不能为空','汽车ID不能为空','订单ID不能为空','审核人ID不能为空','车审后应该赔偿的总价不能为空','该订单油电总价不能为空','该汽车的服务费不能为空','订单租车金额不能为空','订单押金不能为空','还需支付总数不能为空'];
        let canSet = true;
        console.log(this.form);
        for(let i=0;i<mustData.length;i++) {
            if($("#"+mustData[i]).val()==''){
                layer.msg("必填:"+mustDataTip[i], {icon: 5});

                canSet = false;
                break;
            }
        };
        if(canSet){

            if(type==1){
                layer.confirm("确认使用支付宝支付吗？", {btn: ['确定', '取消'],cancel: function () {
                }}, function () {
                    location.href = "/ZhiFuZJ?"+
                        "WIDout_trade_no="+$("#checkId").val()+
                        "&WIDtotal_amount="+$("#allP").val()+
                        "&WIDsubject=租车租金"+
                        "&WIDbody=租车租金，不包含违章罚款";
                });

            }else {

                layer.confirm("确认使用现金支付吗？", {btn: ['确定', '取消'], title: "提示"}, function () {
                    location.href = "/ZJPriceYes?"+
                        "out_trade_no="+$("#checkId").val()+
                        "&total_amount="+$("#allP").val()
                })

            }
        }
    }


</script>